#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int sn(int a, int n)
{
	int sum = 0;
	int tmp = 0;
	for (int i = 0;i < n;i++)
	{
		tmp = tmp * 10 + a;
		sum += tmp;
	}
	return sum;
}
int main()
{
	int n = 0;
	int a = 0;
	scanf("%d", &a);
	scanf("%d", &n);
	int Sn = sn(a, n);
	printf("%d", Sn);

}